package ac.il.technion.cs236635.project.core;

import java.util.ArrayList;
import java.util.List;

public class FinishedJobsRegistration {

	private final static FinishedJobsRegistration _instance = new FinishedJobsRegistration( );
	
	private List<Integer> finished = new ArrayList<Integer>( );
	
	private FinishedJobsRegistration( ) {
		
	}
	
	public static synchronized FinishedJobsRegistration getInstance( ) {
		return _instance;
	}
	
	public synchronized void markFinished( int jobId) {
		finished.add( jobId);
	}
	
	public synchronized boolean isJobFinished( int jobId) {
		return finished.contains( Integer.valueOf( jobId));
	}
}
